/****************************************************************************
* copyright            : (C) 2009 William Viana Soares <vianasw@gmail.com>  *
*****************************************************************************/

/****************************************************************************
*                                                                           *
*   This program is free software; you can redistribute it and/or modify    *
*   it under the terms of the GNU General Public License as published by    *
*   the Free Software Foundation; either version 2 of the License, or       *
*   (at your option) any later version.                                     *
*                                                                           *
*****************************************************************************/

#include "scene.h"
#include "point.h"
#include "querymaker.h"
#include <iostream>
#include <boost/asio.hpp>
#include <vector>

using namespace std;
using namespace ConciseQSR;

int main( int argc, char **argv )
{
    boost::asio::io_service io_service;
    QueryMaker *qm = new QueryMaker( io_service, "localhost", "4243" );
    Point a( "A", 1, 2 );
    Point b( "B", 2, 3 );
    Point c( "C", 4, 5 );
    Point d( "D", 7, 3 );
    Point e( "E", 8, 4 );
    
    vector< Point > points;
    points.push_back( a );
    points.push_back( b );
    points.push_back( c );
    points.push_back( d );
    points.push_back( e );
    Scene scene( points, qm );
    Point f( "F", 7, 5 );
    cout << "Initial scene" << endl;
    cout << scene << endl;
    cout << "-----------------------------------------------------------------" << endl;
    Reference ed( e, d );
    vector< string > relations;
    cout << "Get B wrt ED:" << endl;
    relations = scene.getRelations( b, ed );
    cout << "B is (";
		int size = relations.size();
    for( int i = 0; i < size; i++ )
        cout << relations[ i ] << " ";
    cout << ") wrt " << ed << endl;
    cout << "-----------------------------------------------------------------" << endl;
    cout << "scene after getRelations call" << endl;
    cout << scene << endl;
    cout << "-----------------------------------------------------------------" << endl;
    cout << "scene after adding point F and ref sys DE" << endl;
    scene.addPoint( f, d, e );
    cout << scene << endl;
    cout << "-----------------------------------------------------------------" << endl;
    cout << "bye" << endl;    
    return 0;
}
